

*Use 1971 municipal education institute data. See paper for further details. 
use "$path\edu_institutes.dta", replace  

*Define controls
global municontrols  agrishare_1940 manushare_1940  town city  


*Join the war reparations shock to the 1939 municipality
preserve
use "$temp\municipality_shares_bartik_1939.dta" , clear
keep  bartik  mun39  laani50 $municontrols individual 
egen bartik_standardized=std(bartik) 
rename mun39 kunta
destring kunta, replace 
tempfile shiftshare
save `shiftshare'
restore

joinby kunta using `shiftshare' , unmatched(using)

*Replace missing as zeros as the file only has the ones with istitutes
foreach x  of varlist  ind310-yliopisto_dummy {
        replace `x'=0 if `x'==.
        }
			
gen technical_college=(ind310>0) // Technical colleges (teknilliset oppilaitokset)

gen industry_vocational=(ind331>0) //Industry organized vocational schools (teollisuuden ammattikoulut)

gen vocational=(ind321>0|ind322>0|ind323>0) // Non-industry vocational schools (keskusammattikoulut, kuntaliittojen, kuntien ammattikoulut)

gen college_dummy=(korkeakoulu>0) // Colleges (korkeakoulut)

gen vocational_all=(ind321>0|ind322>0|ind323>0|ind331>0) //  Vocational school keskusammattikoulut, kuntaliittojen, kuntien ammattikoulut

gen HE=(ind310>0|korkeakoulu>0|yliopisto_dummy>0) // Highe educ<tion (technical colleges, colleges, universities)


reg HE  bartik_standardized  $municontrols [aw=indi]  , a(laani50) r
sum HE 
estadd scalar ymean=r(mean)
estimates store HE

reg yliopisto_dummy  bartik_standardized  $municontrols [aw=indi]  , a(laani50) r
sum yliopisto_dummy 
estadd scalar ymean=r(mean)
estimates store yliopisto_dummy

reg college_dummy  bartik_standardized  $municontrols [aw=indi]  , a(laani50) r
sum college_dummy  
estadd scalar ymean=r(mean)
estimates store college_dummy

reg technical_college  bartik_standardized  $municontrols [aw=indi]  , a(laani50) r
sum technical_college  
estadd scalar ymean=r(mean)
estimates store technical_college

reg vocational bartik_standardized  $municontrols [aw=indi]  , a(laani50) r
sum vocational 
estadd scalar ymean=r(mean)
estimates store vocational

reg industry_vocational bartik_standardized  $municontrols [aw=indi]  , a(laani50) r
sum industry_vocational 
estadd scalar ymean=r(mean)
estimates store industry_vocational


label var bartik_standardized "Exposure"

esttab HE yliopisto_dummy college_dummy  technical_college vocational industry_vocational ///
using "$temp\tables\opistot_1971.tex", ///
mgroups("HE institution" "University" "College" "Technical college"  "Vocational"  "Industry Vocational", pattern(1 1  1 1 1 1) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span}) ) ///
replace keep(bartik_standardized ) nonotes ///
b(%9.3f) se(%9.3f)  stats(N  ymean , fmt(0 3) layout(@ @) ///
labels("N"  "Y mean")) label star(* .1 ** .05 *** .01) nodepvars nomtitle




